/*
 *说明：资源账号密码链 增加/修改脚本
 *
 *@author mlc 2013-01-30
*/

var opeForm;
var operationType;

$(function(){

	opeForm=$('#opeForm');
	operationType = $('#operationType').val();

	if (operationType == 0) {
		opeForm.url = 'C_ACC_PWD_HIS!doInsert.do';

	} else if(operationType == 1){
		opeForm.url = 'C_ACC_PWD_HIS!doUpdate.do';

	} 

	$('#okBtn').click(doOk);
	$('#cancelBtn').click(closeWin);
});

//保存按钮操作
function doOk() {

	var validateResult = opeForm.form('validate');

	if (!validateResult){
		showInfoWin('请正确填写信息!');
		return;
	}

	var options = { 
		url: 'C_ACC_PWD_HIS!doAuthRepeat.do',
		type: 'post',
		success: function(data){
			getOpenerWin().document.getElementById("authRepeat").value = data.authRepeat;
			getOpenerWin().queryOperation();
			//getOpenerWin().removeSystemProccessing();
			showInfoWin('操作成功!', function() {window.close();});
		}
	};

	opeForm.ajaxSubmit(options);
}
